package com.chenfan.mcn.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author tangwei
 * Date:     2021/1/10 13:39
 * Description: 操作日志类型枚举
 */

@AllArgsConstructor
@SuppressWarnings("AlibabaEnumConstantsMustHaveComment")
public enum LogBusinessTypeEnum {

    /**
     * 字段修改所属业务类型
     */

    CUSTOMER_PROFILE(0, "客户档案"),

    STAR_INFO(1, "红人信息"),

    YEAR_FRAME_CONTRACT(2, "年框合同"),

    INCOME_CONTRACT(3, "收入合同"),

    EXECUTION_ORDER(4, "正式执行单"),

    INCOME_CONTRACT_AGREEMENT(5, "收入合同补充协议"),

    YEAR_SUPPLEMENTARY_AGREEMENT(6, "年框合同补充协议"),

    INCOME_CONTRACT_COMMENT(7, "收入合同评论"),

    YEAR_FRAME_CONTRACT_COMMENT(8, "年框合同评论"),

    EXECUTION_ORDER_COMMENT(9, "正式执行单评论"),

    CLEAR_ORDER_COMMENT(10, "核销管理评论"),

    TAX_INVOICE_COMMENT(11, "发票管理评论"),

    PURCHASE_CONTRACT_COMMENT(12, "采购合同评论"),

    DISCOUNT_APPROVAL_COMMENT(13, "折扣返点审批单评论"),

    ANNUAL_REBATE_APPROVAL_COMMENT(14, "年度返点审批单评论"),

    STAR_CONTACT_PERSON(15, "红人联系人信息"),

    STAR_PLATFORM_INFO(16, "红人平台信息"),

    STAR_CONTRACT(17, "红人签约合同"),

    STAR_ACCOUNT_INFO(18, "红人收款账号"),

    STAR_REBATE_CONTRACT(19, "红人返点合同"),

    STAR_BILLING_HEADER(20, "红人开票抬头"),

    STAR_MONTHLY_SETTLEMENT(21, "红人月度结算单"),

    SAMPLE_DEVELOPMENT(22,"打样任务"),

    INTENTION_ORDER(23,"前置执行单"),

    VENDOR_CENTER(24, "供应商"),

    LIVE_STAR_SETTLEMENT(25, "直播红人结算单"),

    LIVE_COMMODITY(27, "直播商品管理"),

    SAMPLE_PRICING(28, "样品核价单"),
    ;

    @Getter
    private Integer type;

    @Getter
    private String desc;


    public static String getDesc(Integer type) {
        if(Objects.nonNull(type)) {
            for (LogBusinessTypeEnum item : LogBusinessTypeEnum.values()) {
                if (item.type.equals(type)) {
                    return item.getDesc();
                }
            }
        }
        return null;
    }
}